package com.example.linktestapplication.util;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

public class ToastUtils {

    private static Toast toast;

    /**
     * 短时间显示Toast
     *
     * @param msg 显示的内容-字符串
     */
    public static void showShortToast(Context context, String msg, int time) {
        if (toast == null) {
            toast = Toast.makeText(context, msg, time);
        } else {
            toast.setText(msg);
        }
        toast.show();
    }

}
